#!/bin/bash

killport() {
    local port=$1
    local pids=$(lsof -ti :$port)

    if [ -n "$pids" ]; then
        echo "Killing processes on port $port:"
        for pid in $pids; do
            kill -9 $pid
            echo "Killed process $pid on port $port"
        done
    else
        echo "Port $port not occupied"
    fi
}